package com.bsoft.gol.editor.editor.base;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;

import java.util.Date;
import java.util.Objects;

/**
 * @program: Myproject
 * @description:
 * @author: zangsf
 * @create: 2022-12-17 13:18
 **/
@Entity
@Table(name = "editor_form_qr")
public class EditorFormQr {
    private String editorQrId;
    private String questionnaireId;
    private Byte formType;
    private String orgId;
    private String orgName;
    private Byte objectType;
    private String objectId;
    private String objectName;
    private String qrUrl;
    private Byte status = 1;
    private String createUserId;
    private String createUserName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date createTime;
    private String objectLevel;
    private String objectPhoto;

    @Id
    @Column(name = "editor_qr_Id", nullable = false, length = 40)
    public String getEditorQrId() {
        return editorQrId;
    }

    public void setEditorQrId(String editorQrId) {
        this.editorQrId = editorQrId;
    }

    @Basic
    @Column(name = "questionnaire_id", nullable = true, length = 64)
    public String getQuestionnaireId() {
        return questionnaireId;
    }

    public void setQuestionnaireId(String questionnaireId) {
        this.questionnaireId = questionnaireId;
    }

    @Basic
    @Column(name = "form_type", nullable = false)
    public Byte getFormType() {
        return formType;
    }

    public void setFormType(Byte formType) {
        this.formType = formType;
    }

    @Basic
    @Column(name = "org_id", nullable = true, length = 0)
    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    @Basic
    @Column(name = "org_name", nullable = true, length = 60)
    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    @Basic
    @Column(name = "object_type", nullable = true)
    public Byte getObjectType() {
        return objectType;
    }

    public void setObjectType(Byte objectType) {
        this.objectType = objectType;
    }

    @Basic
    @Column(name = "object_id", nullable = true, length = 40)
    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    @Basic
    @Column(name = "object_name", nullable = true, length = 255)
    public String getObjectName() {
        return objectName;
    }

    public void setObjectName(String objectName) {
        this.objectName = objectName;
    }

    @Basic
    @Column(name = "qr_url", nullable = true, length = 255)
    public String getQrUrl() {
        return qrUrl;
    }

    public void setQrUrl(String qrUrl) {
        this.qrUrl = qrUrl;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_user_id", nullable = true, length = 40)
    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    @Basic
    @Column(name = "create_user_name", nullable = true, length = 255)
    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "object_level", nullable = true)
    public String getObjectLevel() {
        return objectLevel;
    }

    public void setObjectLevel(String objectLevel) {
        this.objectLevel = objectLevel;
    }
    @Basic
    @Column(name = "object_photo", nullable = true)
    public String getObjectPhoto() {
        return objectPhoto;
    }

    public void setObjectPhoto(String objectPhoto) {
        this.objectPhoto = objectPhoto;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EditorFormQr that = (EditorFormQr) o;
        return Objects.equals(editorQrId, that.editorQrId) &&
                Objects.equals(questionnaireId, that.questionnaireId) &&
                Objects.equals(formType, that.formType) &&
                Objects.equals(orgId, that.orgId) &&
                Objects.equals(orgName, that.orgName) &&
                Objects.equals(objectType, that.objectType) &&
                Objects.equals(objectId, that.objectId) &&
                Objects.equals(objectName, that.objectName) &&
                Objects.equals(qrUrl, that.qrUrl) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createUserId, that.createUserId) &&
                Objects.equals(createUserName, that.createUserName) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(editorQrId, questionnaireId, formType, orgId, orgName, objectType, objectId, objectName, qrUrl, status, createUserId, createUserName, createTime);
    }
}
